<%@ page import="ar.com.binarit.Person" %>



<div class="fieldcontain ${hasErrors(bean: personInstance, field: 'username', 'error')} required">
	<label for="username">
		<g:message code="person.username.label" default="Username" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="username" required="" value="${personInstance?.username}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: personInstance, field: 'password', 'error')} required">
	<label for="password">
		<g:message code="person.password.label" default="Password" />
		<span class="required-indicator">*</span>
	</label>
	<g:textField name="password" required="" value="${personInstance?.password}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: personInstance, field: 'email', 'error')} ">
	<label for="email">
		<g:message code="person.email.label" default="Email" />
		
	</label>
	<g:field type="email" name="email" value="${personInstance?.email}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: personInstance, field: 'tipoUsuario', 'error')} ">
	<label for="tipoUsuario">
		<g:message code="person.tipoUsuario.label" default="Tipo Usuario" />
		
	</label>
	<g:select id="tipoUsuario" name="tipoUsuario.id" from="${ar.com.binarit.entities.TipoUsuario.list()}" optionKey="id" value="${personInstance?.tipoUsuario?.id}" class="many-to-one" noSelection="['null': '']"/>
</div>

<div class="fieldcontain ${hasErrors(bean: personInstance, field: 'nickname', 'error')} ">
	<label for="nickname">
		<g:message code="person.nickname.label" default="Nickname" />
		
	</label>
	<g:textField name="nickname" maxlength="100" value="${personInstance?.nickname}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: personInstance, field: 'imgAvatar', 'error')} ">
	<label for="imgAvatar">
		<g:message code="person.imgAvatar.label" default="Img Avatar" />
		
	</label>
	<g:textField name="imgAvatar" value="${personInstance?.imgAvatar}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: personInstance, field: 'equipo', 'error')} ">
	<label for="equipo">
		<g:message code="person.equipo.label" default="Equipo" />
		
	</label>
	<g:select id="equipo" name="equipo.id" from="${ar.com.binarit.entities.Equipo.list()}" optionKey="id" value="${personInstance?.equipo?.id}" class="many-to-one" noSelection="['null': '']"/>
</div>

<div class="fieldcontain ${hasErrors(bean: personInstance, field: 'usuariosBloqueados', 'error')} ">
	<label for="usuariosBloqueados">
		<g:message code="person.usuariosBloqueados.label" default="Usuarios Bloqueados" />
		
	</label>
	<g:select name="usuariosBloqueados" from="${ar.com.binarit.Person.list()}" multiple="multiple" optionKey="id" size="5" value="${personInstance?.usuariosBloqueados*.id}" class="many-to-many"/>
</div>

<div class="fieldcontain ${hasErrors(bean: personInstance, field: 'cuentasBancarias', 'error')} ">
	<label for="cuentasBancarias">
		<g:message code="person.cuentasBancarias.label" default="Cuentas Bancarias" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${personInstance?.cuentasBancarias?}" var="c">
    <li><g:link controller="cuentaBancaria" action="show" id="${c.id}">${c?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="cuentaBancaria" action="create" params="['person.id': personInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'cuentaBancaria.label', default: 'CuentaBancaria')])}</g:link>
</li>
</ul>

</div>

<div class="fieldcontain ${hasErrors(bean: personInstance, field: 'nombre', 'error')} ">
	<label for="nombre">
		<g:message code="person.nombre.label" default="Nombre" />
		
	</label>
	<g:textField name="nombre" maxlength="100" value="${personInstance?.nombre}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: personInstance, field: 'apellido', 'error')} ">
	<label for="apellido">
		<g:message code="person.apellido.label" default="Apellido" />
		
	</label>
	<g:textField name="apellido" maxlength="100" value="${personInstance?.apellido}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: personInstance, field: 'telefono', 'error')} ">
	<label for="telefono">
		<g:message code="person.telefono.label" default="Telefono" />
		
	</label>
	<g:textField name="telefono" maxlength="100" value="${personInstance?.telefono}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: personInstance, field: 'anioNacimiento', 'error')} ">
	<label for="anioNacimiento">
		<g:message code="person.anioNacimiento.label" default="Anio Nacimiento" />
		
	</label>
	<g:field name="anioNacimiento" type="number" value="${personInstance.anioNacimiento}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: personInstance, field: 'documento', 'error')} ">
	<label for="documento">
		<g:message code="person.documento.label" default="Documento" />
		
	</label>
	<g:textField name="documento" value="${personInstance?.documento}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: personInstance, field: 'auto', 'error')} ">
	<label for="auto">
		<g:message code="person.auto.label" default="Auto" />
		
	</label>
	<g:select id="auto" name="auto.id" from="${ar.com.binarit.entities.Auto.list()}" optionKey="id" value="${personInstance?.auto?.id}" class="many-to-one" noSelection="['null': '']"/>
</div>

<div class="fieldcontain ${hasErrors(bean: personInstance, field: 'accountExpired', 'error')} ">
	<label for="accountExpired">
		<g:message code="person.accountExpired.label" default="Account Expired" />
		
	</label>
	<g:checkBox name="accountExpired" value="${personInstance?.accountExpired}" />
</div>

<div class="fieldcontain ${hasErrors(bean: personInstance, field: 'accountLocked', 'error')} ">
	<label for="accountLocked">
		<g:message code="person.accountLocked.label" default="Account Locked" />
		
	</label>
	<g:checkBox name="accountLocked" value="${personInstance?.accountLocked}" />
</div>

<div class="fieldcontain ${hasErrors(bean: personInstance, field: 'enabled', 'error')} ">
	<label for="enabled">
		<g:message code="person.enabled.label" default="Enabled" />
		
	</label>
	<g:checkBox name="enabled" value="${personInstance?.enabled}" />
</div>

<div class="fieldcontain ${hasErrors(bean: personInstance, field: 'lugaresPreferidos', 'error')} ">
	<label for="lugaresPreferidos">
		<g:message code="person.lugaresPreferidos.label" default="Lugares Preferidos" />
		
	</label>
	
<ul class="one-to-many">
<g:each in="${personInstance?.lugaresPreferidos?}" var="l">
    <li><g:link controller="lugarPreferido" action="show" id="${l.id}">${l?.encodeAsHTML()}</g:link></li>
</g:each>
<li class="add">
<g:link controller="lugarPreferido" action="create" params="['person.id': personInstance?.id]">${message(code: 'default.add.label', args: [message(code: 'lugarPreferido.label', default: 'LugarPreferido')])}</g:link>
</li>
</ul>

</div>

<div class="fieldcontain ${hasErrors(bean: personInstance, field: 'passwordExpired', 'error')} ">
	<label for="passwordExpired">
		<g:message code="person.passwordExpired.label" default="Password Expired" />
		
	</label>
	<g:checkBox name="passwordExpired" value="${personInstance?.passwordExpired}" />
</div>

<div class="fieldcontain ${hasErrors(bean: personInstance, field: 'valorRanking', 'error')} required">
	<label for="valorRanking">
		<g:message code="person.valorRanking.label" default="Valor Ranking" />
		<span class="required-indicator">*</span>
	</label>
	<g:field name="valorRanking" type="number" value="${personInstance.valorRanking}" required=""/>
</div>

<div class="fieldcontain ${hasErrors(bean: personInstance, field: 'viajesQueParticipo', 'error')} ">
	<label for="viajesQueParticipo">
		<g:message code="person.viajesQueParticipo.label" default="Viajes Que Participo" />
		
	</label>
	<g:select name="viajesQueParticipo" from="${ar.com.binarit.entities.Viaje.list()}" multiple="multiple" optionKey="id" size="5" value="${personInstance?.viajesQueParticipo*.id}" class="many-to-many"/>
</div>

<div class="fieldcontain ${hasErrors(bean: personInstance, field: 'viajesRealizados', 'error')} ">
	<label for="viajesRealizados">
		<g:message code="person.viajesRealizados.label" default="Viajes Realizados" />
		
	</label>
	<g:select name="viajesRealizados" from="${ar.com.binarit.entities.Viaje.list()}" multiple="multiple" optionKey="id" size="5" value="${personInstance?.viajesRealizados*.id}" class="many-to-many"/>
</div>

